<div class="wide form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'action'=>Yii::app()->createUrl($this->route),
	'method'=>'get',
)); ?>

	<div class="row">
		<?php echo $form->label($model,'id'); ?>
		<?php echo $form->textField($model,'id'); ?>
	</div>

	<div class="row">
		<?php echo $form->label($model,'status'); ?>
		<?php echo $form->dropDownList($model, 'status', Service::getStatusArray(),array('empty'=>''));?>
	</div>

	<div class="row">
		<?php echo CHtml::label('Req. Date', '');?>
		From
		<?php echo $form->hiddenField($model,'minRequestDate'); ?>
		<?php 
			$this->widget('zii.widgets.jui.CJuiDatePicker', array(
			    'name'=>'minRequestDateSelect',
			    'options'=>array(
					'altField'=>'#'.CHtml::activeId($model, "minRequestDate"),
			    ),		   
			));
		?>
		To
		<?php echo $form->hiddenField($model,'maxRequestDate'); ?>
		<?php 
			$this->widget('zii.widgets.jui.CJuiDatePicker', array(
			    'name'=>'maxRequestDateSelect',
			    'options'=>array(
					'altField'=>'#'.CHtml::activeId($model, "maxRequestDate"),				
			    ),		   
			));
		?>
	</div>

	<div class="row">
		<?php echo $form->label($model,'LastName'); ?>
		<?php echo $form->textField($model,'LastName',array('size'=>55,'maxlength'=>100)); ?>
	</div>

	<div class="row">
		<?php echo $form->label($model, 'productType',array('label'=>'Pro. Type'));?>
		<?php echo $form->dropDownList($model, 'productType', Product::getProductTypes(),array('empty'=>''));?>
	</div>

	<div class="row">
		<?php echo CHtml::label('Purch. Date', '');?>
		From
		<?php echo $form->hiddenField($model,'minPurchaseDate'); ?>
		<?php 
			$this->widget('zii.widgets.jui.CJuiDatePicker', array(
			    'name'=>'minPurchaseDateSelect',
			    'options'=>array(
					'altField'=>'#'.CHtml::activeId($model, "minPurchaseDate"),				
			    ),		   
			));
		?>
		To
		<?php echo $form->hiddenField($model,'maxPurchaseDate'); ?>
		<?php 
			$this->widget('zii.widgets.jui.CJuiDatePicker', array(
			    'name'=>'maxPurchaseDateSelect',
			    'options'=>array(
					'altField'=>'#'.CHtml::activeId($model, "maxPurchaseDate"),				
			    ),		   
			));
		?>
	</div>

	<div class="row">
		<?php echo $form->label($model,'technicianId'); ?>
		<?php echo $form->dropDownList($model, 'technicianId', Installer::getTechnicianList(),array('empty'=>''));?>
	</div>

<?php /**
	<div class="row">
		<?php echo CHtml::label("Choose Store",'storeSelector'); ?>
		<?php 
				  $this->widget('zii.widgets.jui.CJuiAutoComplete', array(
				     'name'=>'storeSelector',
				     'sourceUrl'=>array('ajaxSearchStore'),
					 // additional javascript options for the autocomplete plugin
				     'options'=>array(
				         'showAnim'=>'fold',
	              		 'minLength'=>2,
	                     'select'=>'js:function(event,ui){
	                     	$("#ServiceSearch_storeId").val(ui.item.id.trim());
	                     }',
					  ),
				      'htmlOptions'=>array(
				      	'style'=>'width:300px;'  
				       ),
				  ));
	    ?>
	    <?php echo $form->hiddenField($model,'storeId'); ?>
	    <div class="hint"; style="margin-left: 0px">Input 2 letters of the store name or code to select a store</div>
	</div>

	<div class="row">
		<?php echo $form->label($model,'serialNo'); ?>
		<?php echo $form->textField($model,'serialNo',array('size'=>55,'maxlength'=>255)); ?>
	</div>

	<div class="row">
		<?php echo $form->label($model,'fundsRecovered'); ?>
		<?php echo $form->dropDownList($model, 'fundsRecovered', DataUtil::getOptionYesNoEmpty());?>
	</div>

	<div class="row">
		<?php echo $form->label($model,'paymentType'); ?>
		<?php echo $form->dropDownList($model, 'paymentType',ServicePayment::getPaymentTypes());?>
	</div>

	<div class="row">
		<?php echo $form->label($model,'technicainPaid'); ?>
		<?php echo $form->dropDownList($model, 'technicainPaid', DataUtil::getOptionYesNoEmpty());?>
	</div>

	<div class="row">
		<?php echo $form->label($model,'firstName'); ?>
		<?php echo $form->textField($model,'firstName',array('size'=>55,'maxlength'=>100)); ?>
	</div>
	
	<div class="row">
		<?php echo $form->label($model,'suburb'); ?>
		<?php echo $form->textField($model,'suburb',array('size'=>55,'maxlength'=>100)); ?>
	</div>

	<div class="row">
		<?php echo $form->label($model,'postcode'); ?>
		<?php echo $form->textField($model,'postcode',array('size'=>45,'maxlength'=>45)); ?>
	</div>

	<div class="row">
		<?php echo $form->label($model,'state'); ?>
		<?php echo $form->dropDownList($model, 'state', DataUtil::getStates());?>
	</div>

	<div class="row">
		<?php echo $form->label($model,'homePhone'); ?>
		<?php echo $form->textField($model,'homePhone',array('size'=>45,'maxlength'=>45)); ?>
	</div>

	<div class="row">
		<?php echo $form->label($model,'workPhone'); ?>
		<?php echo $form->textField($model,'workPhone',array('size'=>45,'maxlength'=>45)); ?>
	</div>

	<div class="row">
		<?php echo $form->label($model,'mobile'); ?>
		<?php echo $form->textField($model,'mobile',array('size'=>45,'maxlength'=>45)); ?>
	</div>

	<div class="row">
		<?php echo $form->label($model,'email'); ?>
		<?php echo $form->textField($model,'email',array('size'=>55,'maxlength'=>255)); ?>
	</div>

	<div class="row">
		<?php echo $form->label($model,'stairs'); ?>
		<?php echo $form->textField($model,'stairs'); ?>
	</div>


	<div class="row">
		<?php echo CHtml::label("Product",'productSelector'); ?>
		<?php 
				  $this->widget('zii.widgets.jui.CJuiAutoComplete', array(
				     'name'=>'productSelector',
				     'sourceUrl'=>array('ajaxSearchProduct'),
					 // additional javascript options for the autocomplete plugin
				     'options'=>array(
				         'showAnim'=>'fold',
	              		 'minLength'=>2,
	                     'select'=>'js:function(event,ui){
	                     	$("#ServiceSearch_productId").val(ui.item.id.trim());
	                     }',
					  ),
				      'htmlOptions'=>array(
				      	'style'=>'width:300px;'
				       ),
				  ));
	    ?>
	    <?php echo $form->hiddenField($model,'productId'); ?>
	    <div class="hint"; style="margin-left: 0px">Input 2 letters of the product name or model number or type to select a product</div>
	</div>

	<div class="row">
		<?php echo $form->label($model,'generalComment'); ?>
		<?php echo $form->textArea($model,'generalComment',array('rows'=>6, 'cols'=>45)); ?>
	</div>

	<div class="row">
		<?php echo $form->label($model,'partComment'); ?>
		<?php echo $form->textArea($model,'partComment',array('rows'=>6, 'cols'=>45)); ?>
	</div>

	<div class="row">
		<?php echo $form->label($model,'warranty'); ?>
		<?php echo $form->dropDownList($model,'warranty',DataUtil::getOptionYesNoEmpty()); ?>
	</div>
	
	<div class="row">
		<?php echo $form->label($model,'faultDescription'); ?>
		<?php echo $form->textArea($model,'faultDescription',array('rows'=>6, 'cols'=>45)); ?>
	</div>

	<div class="row">
		<?php echo $form->label($model,'customerAccountNo'); ?>
		<?php echo $form->textField($model,'customerAccountNo',array('size'=>55,'maxlength'=>100)); ?>
	</div>

	<div class="row">
		<?php echo $form->label($model,'storeTinNo'); ?>
		<?php echo $form->textField($model,'storeTinNo',array('size'=>55,'maxlength'=>100)); ?>
	</div>

	<div class="row">
		<?php echo $form->label($model,'otherInstruction'); ?>
		<?php echo $form->textArea($model,'otherInstruction',array('rows'=>6, 'cols'=>45)); ?>
	</div>

	<div class="row">
		<?php echo $form->label($model,'dateCommenced'); ?>
		<?php echo $form->textField($model,'dateCommenced'); ?>
	</div>

	<div class="row">
		<?php echo $form->label($model,'dateCompleted'); ?>
		<?php echo $form->textField($model,'dateCompleted'); ?>
	</div>

	<div class="row">
		<?php echo $form->label($model,'customerCharge'); ?>
		<?php echo $form->textField($model,'customerCharge',array('size'=>8,'maxlength'=>8)); ?>
	</div>

	<div class="row">
		<?php echo $form->label($model,'chargeApplicable'); ?>
		<?php echo $form->dropDownList($model,'chargeApplicable',DataUtil::getOptionYesNoEmpty());?>
	</div>

	<div class="row">
		<?php echo $form->label($model,'technicainPaidAmount'); ?>
		<?php echo $form->textField($model,'technicainPaidAmount',array('size'=>8,'maxlength'=>8)); ?>
	</div>

	<div class="row">
		<?php echo $form->label($model,'workCarriedOut'); ?>
		<?php echo $form->dropDownList($model, 'workCarriedOut', DataUtil::getOptionYesNoEmpty());//textField($model,'workCarriedOut'); ?>
	</div>
	
	<div class="row">
		<?php echo $form->label($model,'note'); ?>
		<?php echo $form->textArea($model,'note',array('rows'=>6, 'cols'=>45)); ?>
	</div>
	<div class="row">
		<?php echo $form->label($model,'storeId'); ?>
		<?php echo $form->textField($model,'storeId'); ?>
	</div>

	<div class="row">
		<?php echo $form->label($model,'address'); ?>
		<?php echo $form->textField($model,'address',array('size'=>55,'maxlength'=>255)); ?>
	</div>

	<div class="row">
		<?php echo $form->label($model,'emailNote'); ?>
		<?php echo $form->textArea($model,'emailNote',array('rows'=>6, 'cols'=>45)); ?>
	</div>
**/?>

	<div class="row buttons">
		<?php echo CHtml::submitButton('Search'); ?>
		<?php echo CHtml::resetButton('Reset', array('onclick'=>'$(".row input:hidden").val("");'));?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- search-form -->